<?php

namespace app\utils\script\ele\feedback;

use app\utils\script\JSScript;

/**
 * upload组件上传成功处理事件
 */
class UploadSuccess implements JSScript{
    private $txt = '';
    private $arg = '';

    /**
     * @param string|JSScript $calljs 可执行JS代码  可用参数：response,uploadFile
     */
    public function __construct($calljs)
    {
        $txt=$calljs;
        if($calljs instanceof JSScript){
            $txt=$calljs->text();
        }
        $this->arg= 'response, uploadFile';
        $this->txt= '
        '.$txt.'
        ';
    }
    public function text(){
        return $this->txt;
    }
    public function argv(){
        return '('.$this->arg.')';
    }
}